USE [influenza]
GO

/****** Object:  StoredProcedure [dbo].[SP_labMotivoRechazo]    Script Date: 02/11/2010 17:52:39 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


ALTER PROCEDURE [dbo].[SP_labMotivoRechazo]
@param int
as
Begin
declare @qry VARCHAR(8000)
SET @qry='Select  id_rechazo,rechazo from cat_lab_rechazo'

if @param=2
	begin
		SET @qry= @qry+' Where id_rechazo in(1,2,4,7,13)'
	end	
if @param=3 
	begin
		SET @qry= @qry+' Where id_rechazo in(3,4,5,6,7,8,9,10,11,12,13,14,15,16)'
	end
	
exec (@qry)	
END
GO

